package com.example.demo.mapper;


import com.example.demo.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Mapper
@Repository
public interface UserMapper {
    @Select("select * from user")
    List<User> queryUserList();

    @Select("select * from user where id = #{id}")
    User queryUserById(Integer id);

    @Insert("insert into user(username,password,blance) values(#{username},#{password},#{blance})")
    int addUser(User user);

    @Update("update user set username = #{username},password = #{password},blance = #{blance} where id = #{id}")
    int updateUser(User user);

    @Delete("delete from user where id = #{id}")
    int deleteUser(Integer id);

}
